ICAEW.com works better with JavaScript enabled.
Exclusive

Excel Tip of the Week #371: Revisiting ROW(S) and COLUMN(S) functions

Author: David Lyford-Smith

Published: 08 Dec 2020

Exclusive content
Access to our exclusive resources is for specific groups of students, users, subscribers and members.

Hello all and welcome back to the Excel Tip of the Week! This week, we have a General User post in which we’re taking a fresh new look at these four simple but very useful functions: ROW, COLUMN, ROWS, and COLUMNS.

ROW and COLUMN

These two simple functions both work with the position of cells in Excel itself.  They can tell you the row number or column number of a cell:

Excel screenshot1

Note that the column result is numeric even though the default Excel view uses letters to denote each column.

These functions can also just return the row/column that the formula itself is in, by entering them without an input:

Excel screenshot2

These functions are very commonly used for all kinds of applications where a simple counter is needed – for example if you want an invoice number that ticks up with each row, or you want a calendar that counts by rows. Doing this with ROW or COLUMN instead of by adding one to a previous cell means that the numbering behaves better when sorted. If you create a numbering by adding 1 to the previous row’s number, it will break when the data is sorted; however create numbering using ROW and it will not change even if the data is sorted.

However do note that such numberings are affected by adding rows / columns later on. To fix this, if you are going to use ROW for numbering, try to calculate based on the position of the cell relative to the header, not to the worksheet row:

Excel screenshot3

ROWS, COLUMNS

These two functions just count the number of rows / columns in a given reference:

Excel screenshot4

These are most commonly used for a quick count of the size of a named range or Excel Table – either for statistics purposes, or because you need the total in order to compute some subsequent thing.

Just like ROW and COLUMN, these of course can change later on if new rows / columns are inserted in-between the references of the function, so do watch out for that when considering if your approach is future-proof.

In earlier versions of Excel, ROW and friends were sometimes used to generate arrays of numbers for use in array formulas – for example ROW(A1:A10) would generate an array of the numbers 1-10 if confirmed with Ctrl Shift Enter. If you have Office 365 this functionality is now replaced by the SEQUENCE function, but the option does still exist if you are on earlier versions.

Excel community

This article is brought to you by the Excel Community where you can find additional extended articles and webinar recordings on a variety of Excel related topics. In addition to live training events, Excel Community members have access to a full suite of online training modules from Excel with Business.

Excel polaroid
Topics
Open AddCPD icon

Add Verified CPD Activity

Introducing AddCPD, a new way to record your CPD activities!

Log in to start using the AddCPD tool. Available only to ICAEW members.

Add this page to your CPD activity

Step 1 of 3
Download recorded
Download not recorded

Please download the related document if you wish to add this activity to your record

What time are you claiming for this activity?
Mandatory fields

Add this page to your CPD activity

Step 2 of 3
Mandatory field

Add activity to my record

Step 3 of 3
Mandatory field

Activity added

An error has occurred
Please try again

If the problem persists please contact our helpline on +44 (0)1908 248 250